import numpy as np

if __name__ == '__main__':
    matrix_1d = np.array([1, 2, 3, 4])
    print(matrix_1d)

    # matrix_1d = np.array([128, 129, 130, 131], dtype=np.int8)
    matrix_1d = np.array([128, 129, 130, 131], dtype=np.int16)
    print(matrix_1d)

    a = np.array([2, 3, 4], dtype=np.int32)
    b = np.array([5, 6, 7], dtype=np.uint32)
    # 在运算的过程中可能会进行类型的转换
    c = b - a
    print('c type:', c.dtype)

    # 进行类型的转换
    d = c.astype(np.uint32)
    print('d type:', d.dtype)

